package com.ylfstu.single_;

public class SingleTon03 {

}

class GirlFriend1{
    private String name;
    public static GirlFriend1 girlFriend1 = new GirlFriend1("AA");

    private GirlFriend1(String name){
        this.name = name;
    }

    public static GirlFriend1 getInstance() {
        return new GirlFriend1("小红");
    }

    @Override
    public String toString() {
        return "GirlFriend1{" +
                "name='" + name + '\'' +
                '}';
    }
}